//
// NeL - bindings
// Copyright (C) 2010 Naush
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU Affero General Public License as
//published by the Free Software Foundation, either version 3 of the
//License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU Affero General Public License for more details.
//
//You should have received a copy of the GNU Affero General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.
package org.ryzom.nel.misc;

public class CSystemUtils {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CSystemUtils(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CSystemUtils obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nelmiscJNI.delete_CSystemUtils(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public static boolean init() {
    return nelmiscJNI.CSystemUtils_init();
  }

  public static boolean uninit() {
    return nelmiscJNI.CSystemUtils_uninit();
  }

  public static void setWindow(int window) {
    nelmiscJNI.CSystemUtils_setWindow(window);
  }

  public static boolean updateProgressBar(long value, long total) {
    return nelmiscJNI.CSystemUtils_updateProgressBar(value, total);
  }

  public static boolean copyTextToClipboard(ucstring text) {
    return nelmiscJNI.CSystemUtils_copyTextToClipboard(ucstring.getCPtr(text), text);
  }

  public static boolean pasteTextFromClipboard(ucstring text) {
    return nelmiscJNI.CSystemUtils_pasteTextFromClipboard(ucstring.getCPtr(text), text);
  }

  public static boolean supportUnicode() {
    return nelmiscJNI.CSystemUtils_supportUnicode();
  }

  public static boolean isAzertyKeyboard() {
    return nelmiscJNI.CSystemUtils_isAzertyKeyboard();
  }

  public static boolean isScreensaverEnabled() {
    return nelmiscJNI.CSystemUtils_isScreensaverEnabled();
  }

  public static boolean enableScreensaver(boolean screensaver) {
    return nelmiscJNI.CSystemUtils_enableScreensaver(screensaver);
  }

  public static String getRootKey() {
    return nelmiscJNI.CSystemUtils_getRootKey();
  }

  public static void setRootKey(String root) {
    nelmiscJNI.CSystemUtils_setRootKey(root);
  }

  public static String getRegKey(String Entry) {
    return nelmiscJNI.CSystemUtils_getRegKey(Entry);
  }

  public static boolean setRegKey(String ValueName, String Value) {
    return nelmiscJNI.CSystemUtils_setRegKey(ValueName, Value);
  }

  public static long getCurrentColorDepth() {
    return nelmiscJNI.CSystemUtils_getCurrentColorDepth();
  }

  public CSystemUtils() {
    this(nelmiscJNI.new_CSystemUtils(), true);
  }

}
